package com.woniu.form;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@ApiModel("新增管理员数据")
public class InsertAdminForm {

    @ApiModelProperty("手机号")
    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    String phone;
    @Length(min = 1, max = 10, message = "用户名长度在1-10位之间")
    @NotNull(message = "用户名不能为空")
    @ApiModelProperty("用户名")
    String userName;
    @Length(min = 1, max = 10, message = "密码长度在1-10位之间")
    @NotNull(message = "密码不能为空")
    @ApiModelProperty("密码")
    String passWord;
}
